package com.blb.service.impl;

import com.blb.entity.Order;
import com.blb.mapper.OrderMapper;
import com.blb.service.IOrderService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.blb.utils.ShiroUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wss
 * @since 2020-05-22
 */
@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements IOrderService {

    @Resource
    private OrderMapper orderMapper;

    @Override
    public List<Order> getPages(Integer start, Integer length, String sldd,@Param("orderStatus") String orderStatus
            ,@Param("orderId")String orderId ,@Param("orderTime")String orderTime,@Param("cuId")String cuId) {
        return orderMapper.getPages(start,length,sldd,orderStatus,orderId,orderTime,cuId);
    }

    @Override
    public Integer getCount(String cuId) {
        return orderMapper.getCount(cuId);
    }

    @Override
    public Integer getCount(String cuId, String orderStatus) {
        return orderMapper.getCount(cuId, orderStatus);
    }

    @Override
    public Order getByOrderID(String orderId) {
        return orderMapper.getByOrderID(orderId);
    }

    @Override
    public String getSumById(String orderId) {
        return orderMapper.getSumById(orderId);
    }

    @Override
    public Order getAll(String orderId) {
        return orderMapper.getAll(orderId);
    }

    @Override
    public Integer getCountByOrderStatus(@Param("orderStatus")String orderStatus,@Param("cuId")String cuId) {
        return orderMapper.getCountByOrderStatus(orderStatus,cuId);
    }


}
